package model

import (
	"duoke/tables"
)

type ReqSeparateAccounts struct {
	Id                 int    `xorm:"not null pk autoincr INT(10)" json:"id" form:"id"`
	Name               string `xorm:"" json:"name" form:"name"`
	Mobile             string `xorm:"" json:"mobile" form:"mobile"`
	SubMchId           string `xorm:"" json:"sub_mch_id" form:"sub_mch_id"`
	SubMchName         string `xorm:"" json:"sub_mch_name" form:"sub_mch_name"`
	Commission         int    `xorm:"" json:"commission" form:"commission"`
	PlatformCommission int    `xorm:"" json:"platform_commission" form:"platform_commission"`
	UserCommission     int    `xorm:"" json:"user_commission" form:"user_commission"`
	Acid               int    `xorm:"" json:"acid" form:"acid"`
	CreatedAt          int    `xorm:"created" json:"created_at" form:"created_at"`
	UpdatedAt          int    `xorm:"updated" json:"updated_at" form:"updated_at"`
	DeletedAt          int    `xorm:"deleted" json:"deleted_at" form:"deleted_at"`
	SmallProgramCode   string `xorm:"" json:"small_program_code" form:"small_program_code"`
	Province           int    `xorm:"" json:"province" form:"province"`
	City               int    `xorm:"" json:"city" form:"city"`
	Area               int    `xorm:"" json:"area" form:"area"`
	Address            string `xorm:"" json:"address" form:"address"`
	StorePic           string `xorm:"" json:"store_pic" form:"store_pic"`
}

func (ReqSeparateAccounts) TableName() string {
	return "separate_accounts"
}

type SeparateAccountsList struct {
	tables.SeparateAccounts `xorm:"extends"`
	ProvinceName            string `xorm:"-" json:"province_name" form:"province_name"`
	CityName                string `xorm:"-" json:"city_name" form:"city_name"`
	AreaName                string `xorm:"-" json:"area_name" form:"area_name"`
}

func (SeparateAccountsList) TableName() string {
	return "separate_accounts"
}

type Receivers struct {
	Type        string `json:"type"`
	Account     string `json:"account"`
	Amount      int    `json:"amount"`
	Description string `json:"description"`
}
type CreateOrder struct {
	Amount   float32 `json:"amount" form:"amount" binding:"required"  required_err:"参数缺失【amount】"`
	SubMchId string  `json:"sub_mch_id" form:"sub_mch_id" binding:"required" required_err:"参数缺失【sub_mch_id】"`
	Body     string  `json:"body"`
}

type SeparateApply struct {
	MchId         string  `json:"mch_id"`
	SubMchId      string  `json:"sub_mch_id"`
	OutTradeNo    string  `json:"out_trade_no"`
	TotalFee      float64 `json:"total_fee"`
	Openid        string  `json:"openid"`
	TransactionId string  `json:"transaction_id"`
}
